import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('DelayedDeletionComponent')
export class DelayedDeletionComponent extends Component {

    @property(Number)
    public time: number = 3;

    start() {
        let myThis = this;
        this.scheduleOnce(function(){
            myThis.node.destroy();
        }.bind(this), this.time);
    }

}

